#!/bin/bash

# script to execute and analyse the output of the
# scriptBlackBoxTestsTableTranscriber

# This script must be executed in TableTranscriber2/executableBlackBoxTests/
# folder

mv script_testesBlackBoxTableTranscriber.sh ..

cd ..

sh script_testesBlackBoxTableTranscriber.sh > executableBlackBoxTests/logScriptBlackBoxTestsTableTranscriber.txt 

mv script_testesBlackBoxTableTranscriber.sh executableBlackBoxTests/

cd executableBlackBoxTests/

numTestsGroups=`grep -c "Test" logScriptBlackBoxTestsTableTranscriber.txt`
numUnexpectedErrors=`grep -c "Your entry to this table is invalid. To be valid it need be a rectangle. The system will be closed." logScriptBlackBoxTestsTableTranscriber.txt`
numErrorsNotExplained=`grep -c "Some error ocurred. Please, report the bug to guilherme.gadelha [at] ccc [dot] ufcg [dot] edu [dot] br" logScriptBlackBoxTestsTableTranscriber.txt`

numTests=$(echo "scale=4; $numTestsGroups * 5" | bc)

echo "Results: ------------------------------------"
echo "Number of unexpected errors = $numUnexpectedErrors"
echo "Number of not explained errors = $numErrorsNotExplained"
echo "Number of tests = $numTests"
echo "--------------------------------------------"

